Round-robin with an I/O-bound Process Suppose that we have five processes, four that are cpu-bound and one that is I/O-bound. Suppose that each I/O request takes a bit less than two time slices to complete. Using pure round robin scheduling, we would get the following time line. The key idea here is that when p0 is given the cpu, p0 immediately does an I/O operation and so p0 gets blocked and gives up the cpu to process p1. |------|------|------|------|------|------|------|------|------|------|------|------| p0 p1 p2 | p3 p4 p0 p1 p2 | p3 p4 p0 p1 p2 | p3 p4 p0 | | | I/O I/O I/O done done done Notice that, since we are using pure round robin, process p0 needs to wait its turn before it can issue a new I/O request. But p0 takes up almost no cpu resources, so it would not hurt the other processes to let p0 "cut in line" and make an I/O request as soon as possible. |------|------|------|------|------|------|------|------|------|------|------|------| p0 p1 p2 |p0 p3 p4 |p0 p1 p2 |p0 p3 p4 |p0 p1 p2 |p0 p3 p4 |p0 | | | | | | | | | | | | I/O I/O I/O I/O I/O I/O done done done done done done Notice that now p0 gets to make twice as many I/O requests without there being any penalty to the other processes. And if an I/O operation would take a bit less than one time slice, p0 would get to make twice as many more I/O requests without having any adverse affect on processes p1, p2, p3, and p4. |------|------|------|------|------|------|------|------|------|------|------|------| p0 p1 |p0 p2 |p0 p3 |p0 p4 |p0 p1 |p0 p2 |p0 p3 |p0 p4 |p0 p1 |p0 p2 |p0 p3 |p0 p4 |p0 | | | | | | | | | | | | | | | | | | | | | | | | I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O done done done done done done done done done done done done So we want a modification to round robin that lets a process that wants to make an I/O request go out of turn. But how does the round robin scheduler know which processes are I/O bound and likely to make an I/O request as soon as they get the cpu? That is the problem solved by the MLFQ scheduler.